Book Contents

Numeric variable syntax

Tip:

Embedded variables are case sensitive, and must be in the proper format and syntax to work. If you make a mistake, your variable will be treated as a piece of text. Therefore, do not attempt to edit embedded variables manually. Use the Insert Variable and Edit variable dialog boxes to avoid problems.

Numeric embedded variables use this format:

/*LN:# Tag_name Fill_character DP:#*/

The syntax is:

  • an opening escape sequence ‘/*’
  • followed by an optional letter L (for Literal) preventing a tag read for the variable, (if the Literal number option is chosen in the Numeric Variable dialog box)
  • followed by the letter 'N'
  • followed by a colon ':'
  • followed by a numeric length field
  • followed by a space character
  • followed by the tag name, tag placeholder (#1, #2, etc.)
  • followed by a space character
  • followed by a word describing the left fill property
  • followed by a space character
  • followed by the letters ‘DP:’
  • followed by the number of decimal places
  • followed by a closing escape sequence '*/'

For example, to show the current value of an analog tag called Oven_temp, with 3 digits, two decimal places, and no fill character, you would type:

/*N:6 Oven_temp NOFILL DP:2*/

On the display during development, you would see as many # characters as digits, with the decimal place as specified:

###.##

At run time, you would see the value of the tag displayed in the format specified:

183.00

See also

About embedded variables

Insert a numeric variable